package day04;

public class GenEx05 {                                  //数字加密
    public static void main(String[] args) {
        int password=1983;
        int[] nowArr=ArrEnc(intToArr(password));
        for (int i = 0; i < nowArr.length; i++) {
            System.out.print(nowArr[i]);
        }
    }
    public static int[] intToArr(int num) {
        int count=0,num1=num;
        while(num1>0) {
            num1=num1/10;
            count++;
        }
        int[] arr=new int[count];
        for(int i=0;i<count;i++) {
            arr[count-i-1]=num%10;
            num=num/10;
        }
        return arr;
    }
    public static int[] ArrEnc(int[] arr0) {
        for(int i=0;i<arr0.length;i++) {
            arr0[i]=(arr0[i]+5)%10;
        }
        int[] arr1=new int[arr0.length];
        for(int i=0;i<arr0.length;i++) {
            arr1[i]=arr0[arr0.length-i-1];
        }
        return arr1;
    }
}
